<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title></title>
    <style>
        #parent{
            height: 150px;
            position: relative;  /*父相*/
            background: #ff843b;
        }
        #son{
            position: absolute;  /*子绝*/
            top: 50%;  /*父元素高度一半,这里等同于top:75px;*/
            transform: translateY(-50%);  /*自身高度一半,这里等同于margin-top:-25px;*/
            height: 50px;
        }

    </style>
</head>
<body>

<div id="parent">
    <div id="son"> 儿子</div>
</div>
</body>
</html>